package cn.yuanqiao.archive.danganzhengli.mapper;

import cn.yuanqiao.archive.danganzhengli.domain.FileAssociation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 互见号Mapper接口
 *
 * @author xy
 * @date 2024-10-08
 */
public interface FileAssociationMapper
{
    /**
     * 查询互见号
     *
     * @param id 互见号主键
     * @return 互见号
     */
    public FileAssociation selectFileAssociationById(Long id);

    /**
     * 查询互见号列表
     *
     * @param fileAssociation 互见号
     * @return 互见号集合
     */
    public List<FileAssociation> selectFileAssociationList(@Param("fileAssociation") FileAssociation fileAssociation,@Param("tableName") String tableName,@Param("code") String code);

    /**
     * 新增互见号
     *
     * @param fileAssociation 互见号
     * @return 结果
     */
    public int insertFileAssociation(FileAssociation fileAssociation);

    /**
     * 修改互见号
     *
     * @param fileAssociation 互见号
     * @return 结果
     */
    public int updateFileAssociation(FileAssociation fileAssociation);

    /**
     * 删除互见号
     *
     * @param id 互见号主键
     * @return 结果
     */
    public int deleteFileAssociationById(Long id);

    /**
     * 批量删除互见号
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFileAssociationByIds(@Param("list") Long[] ids, @Param("tableName") String tableName);

    List<Map<String, Object>> selectDaList(@Param("dh") String dh, @Param("tableName") String tableName, @Param("code") String code);

    Long[] getGlIds(@Param("list") Long[] ids, @Param("tableName") String tableName, @Param("daId") Long daId);

    int insertFileAssociationList(@Param("list") List<FileAssociation> fileAssociationList,@Param("tableName") String tableName);

    int getCountRole(@Param("sql") StringBuilder sql);

    List<FileAssociation> selectFileAssociationListByIds(@Param("ids") Long[] ids, @Param("tableName") String tableName);

    int deleteFileAssociationByLists(@Param("list") List<FileAssociation> list, @Param("tableName") String tableName);

    int getCountDaId(@Param("daId") Long daId, @Param("tableName") String tableName);

    List<Map<String, Object>> selectDocRoleDa(@Param("daId") Long daId, @Param("tableName") String tableName);

    int createTables( @Param("tableName") String tableName);
}
